fix(runtime): honor isRetryable flag in provider retry classifier - #3812
fix(runtime): honor isRetryable flag in provider retry classifier#38120xMudit wants to merge 1 commit into
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Update on b61f988a42:
[P2] isRetryableInChain ignores outer isRetryable:false, causes false retry
APICallError(400,false,cause=APICallError(true)) is judged retryable, sending a hard 4xx into up to 10 provider retries. Fix: give nearest explicit boolean (especially false) authority and add regression test.
Also P3: RetryError.lastError unwrapping inconsistency between classifier and helper — unify boundary.
简体中文
重试判断越过显式不可重试标记。f1e4e65 to
54ebadd
Compare
… retry classifier The AI SDK wraps TLS/transport failures as APICallError with isRetryable:true and a 'Cannot connect to API: <cause>' message. Maka's providerRetryMetadata did not check this flag or walk the cause chain, so these failures were classified as non-retryable and the turn exited immediately (apache#3756). - Check isRetryable on the error and up to 8 levels of cause chain - Add regression tests for the exact TLS message from the issue report - Add test for isRetryable on a wrapped cause error Generated-by: opencode/big-pickle
54ebadd to
961a0da
Compare
|
The red
That is exactly why the assertion fails. Your second test is a real gap. In But the fix belongs in Teaching the existing cause walk to accept AI-assisted review: I traced |
Summary
Fixes #3756
The AI SDK wraps TLS/transport failures as \APICallError\ with \isRetryable: true\ and a message like \Cannot connect to API: . Maka's \providerRetryMetadata\ did not check this flag or walk the \cause\ chain, so these failures were classified as non-retryable and the turn exited immediately.
Changes
ormalizeProviderError\ returns undefined.
Verification
pm --workspace @maka/runtime run build: passes
pm --workspace @maka/runtime test: 17/17 pass (including 2 new regression tests)
pm --workspace @maka/core test: 656/656 pass
pm run lint: passes
pm run format:check: passes
AI use
Tool(s) and scope: opencode/big-pickle — diagnosed root cause, implemented fix and regression tests
Checklist
Does this PR entail a change in behavior?